<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Grade_type')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-grade_type" class="form-control selectpicker" name="row[grade_type]">
                {foreach name="gradeTypeList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.grade_type"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Is_tiyan')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-is_tiyan" data-rule="required" class="form-control selectpicker" name="row[is_tiyan]">
                {foreach name="isTiyanList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.is_tiyan"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Mouth')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-mouth" data-rule="required" class="form-control" name="row[mouth]" type="text" value="{$row.mouth|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]" type="number" value="{$row.price|htmlentities}">
        </div>
    </div>
    <div class="form-group row">
        <label class="control-label col-xs-12 col-sm-2">{:__('续费金额月数')}:</label>
        <div class="col-xs-12">
            <table class="table fieldlist" data-template="basictpl" data-name="row[pramsjson]" id="first-table">
                <tr>
                    <td>{:__('月数')}</td>
                    <td>{:__('金额')}</td>
                    <td width="100"></td>
                </tr>
                <tr>
                    <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></td>
                </tr>
            </table>
            <!--请注意实际开发中textarea应该添加个hidden进行隐藏-->
            <textarea name="row[basic]" style="display: none" class="form-control" cols="30" rows="5">{$row.pramsjson}</textarea>
            <script id="basictpl" type="text/html">
                <tr class="form-inline">
                    <td><input type="text" name="<%=name%>[<%=index%>][mouth]" class="form-control" size="15" value="<%=row.mouth%>" placeholder="月数"/></td>
                    <td><input type="text" name="<%=name%>[<%=index%>][price]" class="form-control" size="15" value="<%=row.price%>" placeholder="金额"/></td>
                    <td>
                        <!--下面的两个按钮务必保留-->
                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                    </td>
                </tr>
            </script>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Tags')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-tags" class="form-control" data-role="tagsinput" name="row[tags]" type="text" value="{$row.tags|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-desc" class="form-control" name="row[desc]" type="text" value="{$row.desc|htmlentities}">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
